package cn.gson.boot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

@Entity
public class Chuku {
    private int ckId;//出库id
    private String ckHao;//出库单号
    private Integer ckOtherid;//其它表的id
    private Timestamp ckTime;//出库时间
    private String ckShouming;//出库说明
    private String ckPeople;//操作人
    private int ckYs;//判断是否已经出库(1是，0否)
    private Timestamp ckSqtime;//出库申请时间

    private List<Chukuxiangqin> chukuxiangqinList;

    @Column(name = "ck_sqtime")
    public Timestamp getCkSqtime() {
        return ckSqtime;
    }

    public void setCkSqtime(Timestamp ckSqtime) {
        this.ckSqtime = ckSqtime;
    }

    @Column(name = "ck_ys")
    public int getCkYs() {
        return ckYs;
    }

    public void setCkYs(int ckYs) {
        this.ckYs = ckYs;
    }

    @OneToMany(mappedBy = "chuku")
    public List<Chukuxiangqin> getChukuxiangqinList() {
        return chukuxiangqinList;
    }

    public void setChukuxiangqinList(List<Chukuxiangqin> chukuxiangqinList) {
        this.chukuxiangqinList = chukuxiangqinList;
    }

    @Id
    @Column(name = "ck_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getCkId() {
        return ckId;
    }

    public void setCkId(int ckId) {
        this.ckId = ckId;
    }

    @Basic
    @Column(name = "ck_hao", nullable = true, length = 200)
    public String getCkHao() {
        return ckHao;
    }

    public void setCkHao(String ckHao) {
        this.ckHao = ckHao;
    }

    @Basic
    @Column(name = "ck_otherid", nullable = true)
    public Integer getCkOtherid() {
        return ckOtherid;
    }

    public void setCkOtherid(Integer ckOtherid) {
        this.ckOtherid = ckOtherid;
    }

    @Basic
    @Column(name = "ck_time", nullable = true)
    public Timestamp getCkTime() {
        return ckTime;
    }

    public void setCkTime(Timestamp ckTime) {
        this.ckTime = ckTime;
    }

    @Basic
    @Column(name = "ck_shouming", nullable = true, length = 200)
    public String getCkShouming() {
        return ckShouming;
    }

    public void setCkShouming(String ckShouming) {
        this.ckShouming = ckShouming;
    }

    @Basic
    @Column(name = "ck_people", nullable = true, length = 200)
    public String getCkPeople() {
        return ckPeople;
    }

    public void setCkPeople(String ckPeople) {
        this.ckPeople = ckPeople;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Chuku chuku = (Chuku) o;
        return ckId == chuku.ckId &&
                Objects.equals(ckHao, chuku.ckHao) &&
                Objects.equals(ckOtherid, chuku.ckOtherid) &&
                Objects.equals(ckTime, chuku.ckTime) &&
                Objects.equals(ckShouming, chuku.ckShouming) &&
                Objects.equals(ckPeople, chuku.ckPeople);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ckId, ckHao, ckOtherid, ckTime, ckShouming, ckPeople);
    }
}
